home *** CD-ROM | disk | FTP | other *** search
/ X User Tools / X User Tools (O'Reilly and Associates)(1994).ISO / sun4c / archive / tcltk.z / tcltk / man / catn / tclvars.n < prev    next >
Encoding:
Text File  |  1994-09-20  |  6.9 KB  |  199 lines

  1.  
  2.  
  3.  
  4. tclvars(n)            Tcl Built-In Commands
  5.  
  6.  
  7.  
  8. _________________________________________________________________
  9.  
  10. NAME
  11.      tclvars - Variables used by Tcl
  12. _________________________________________________________________
  13.  
  14.  
  15. DESCRIPTION
  16.      The following  global  variables  are  created  and  managed
  17.      automatically by the Tcl library.  Except where noted below,
  18.      these variables should normally be treated as  read-only  by
  19.      application-specific code and by users.
  20.  
  21.      env
  22.           This variable is maintained by Tcl as  an  array  whose
  23.           elements are the environment variables for the process.
  24.           Reading  an  element  will  return  the  value  of  the
  25.           corresponding environment variable.  Setting an element
  26.           of the array will modify the corresponding  environment
  27.           variable  or  create  a  new  one if it doesn't already
  28.           exist.  Unsetting an element of  env  will  remove  the
  29.           corresponding environment variable.  Changes to the env
  30.           array will affect the environment passed to children by
  31.           commands  like  exec.  If the entire env array is unset
  32.           then Tcl will stop monitoring env accesses and will not
  33.           update environment variables.
  34.  
  35.      errorCode
  36.           After an error has occurred, this variable will be  set
  37.           to  hold  additional  information  about the error in a
  38.           form that is easy to process with programs.   errorCode
  39.           consists  of a Tcl list with one or more elements.  The
  40.           first element of the list identifies a general class of
  41.           errors,  and  determines  the format of the rest of the
  42.           list.  The following formats for errorCode are used  by
  43.           the  Tcl core; individual applications may define addi-
  44.           tional formats.
  45.  
  46.           ARITH _c_o_d_e _m_s_g
  47.                This format  is  used  when  an  arithmetic  error  |
  48.                occurs  (e.g.  an attempt to divide by zero in the  |
  49.                expr command).  _C_o_d_e identifies the precise  error  |
  50.                and  _m_s_g  provides a human-readable description of  |
  51.                the error.  _C_o_d_e will be either  DIVZERO  (for  an  |
  52.                attempt to divide by zero), DOMAIN (if an argument  |
  53.                is outside the  domain  of  a  function,  such  as  |
  54.                acos(-3)),   IOVERFLOW   (for  integer  overflow),  |
  55.                OVERLFLOW (for a floating-point overflow), or UNK-  |
  56.                NOWN  (if  the cause of the error cannot be deter-  |
  57.                mined).
  58.  
  59.           CHILDKILLED _p_i_d _s_i_g_N_a_m_e _m_s_g
  60.  
  61.  
  62.  
  63. Tcl                                                             1
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. tclvars(n)            Tcl Built-In Commands
  71.  
  72.  
  73.  
  74.                This format is used when a child process has  been
  75.                killed because of a signal.  The second element of
  76.                errorCode will be  the  process's  identifier  (in
  77.                decimal).   The third element will be the symbolic
  78.                name of the signal that caused the process to ter-
  79.                minate;  it  will  be  one  of  the names from the
  80.                include  file  signal.h,  such  as  SIGPIPE.   The
  81.                fourth element will be a short human-readable mes-
  82.                sage describing the signal,  such  as  ``write  on
  83.                pipe with no readers'' for SIGPIPE.
  84.  
  85.           CHILDSTATUS _p_i_d _c_o_d_e
  86.                This format is  used  when  a  child  process  has
  87.                exited  with  a  non-zero exit status.  The second
  88.                element of errorCode will be the  process's  iden-
  89.                tifier  (in decimal) and the third element will be
  90.                the exit code returned by  the  process  (also  in
  91.                decimal).
  92.  
  93.           CHILDSUSP _p_i_d _s_i_g_N_a_m_e _m_s_g
  94.                This format is used when a child process has  been
  95.                suspended because of a signal.  The second element
  96.                of errorCode will be the process's identifier,  in
  97.                decimal.   The  third element will be the symbolic
  98.                name of the signal  that  caused  the  process  to
  99.                suspend;  this  will  be one of the names from the
  100.                include  file  signal.h,  such  as  SIGTTIN.   The
  101.                fourth element will be a short human-readable mes-
  102.                sage describing the signal, such  as  ``background
  103.                tty read'' for SIGTTIN.
  104.  
  105.           NONE
  106.                This format is used for errors where no additional
  107.                information  is available for an error besides the
  108.                message returned with the error.  In  these  cases
  109.                errorCode will consist of a list containing a sin-
  110.                gle element whose contents are NONE.
  111.  
  112.           POSIX _e_r_r_N_a_m_e _m_s_g
  113.                If the first element of errorCode is  POSIX,  then  |
  114.                the  error  occurred  during  a POSIX kernel call.
  115.                The second element of the list  will  contain  the
  116.                symbolic  name of the error that occurred, such as
  117.                ENOENT; this will be one of the values defined  in
  118.                the  include  file  errno.h.  The third element of
  119.                the  list  will  be   a   human-readable   message
  120.                corresponding  to  _e_r_r_N_a_m_e, such as ``no such file
  121.                or directory'' for the ENOENT case.
  122.  
  123.           To set errorCode, applications should use library  pro-
  124.           cedures such as Tcl_SetErrorCode and Tcl_PosixError, or  |
  125.           they may invoke the error command.   If  one  of  these
  126.  
  127.  
  128.  
  129. Tcl                                                             2
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. tclvars(n)            Tcl Built-In Commands
  137.  
  138.  
  139.  
  140.           methods hasn't been used, then the Tcl interpreter will
  141.           reset the variable to NONE after the next error.
  142.  
  143.      errorInfo
  144.           After an error has occurred, this string  will  contain
  145.           one or more lines identifying the Tcl commands and pro-
  146.           cedures that were being executed when the  most  recent
  147.           error  occurred.  Its contents take the form of a stack
  148.           trace showing the various nested Tcl commands that  had
  149.           been invoked at the time of the error.
  150.  
  151.      tcl_precision
  152.           If this variable is set,  it  must  contain  a  decimal  |
  153.           number  giving  the  number  of  significant  digits to  |
  154.           include  when  converting  floating-point   values   to  |
  155.           strings.  If this variable is not set then 6 digits are  |
  156.           included.  17 digits is ``perfect'' for IEEE  floating-  |
  157.           point  in  that it allows double-precision values to be  |
  158.           converted to strings and back to binary with no loss of  |
  159.           precision.
  160.  
  161.  
  162. KEYWORDS
  163.      arithmetic, error, environment,  POSIX,  precision,  subpro-
  164.      cess, variables
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195. Tcl                                                             3
  196.  
  197.  
  198.  
  199.